<script>
$(document).ready(function(){
	$('#editshipmentclcik').click(function(){
		$('.grid_table_list_2 input, .grid_table_list_2 select, .grid_table_list_2 textarea').removeAttr('disabled');
		$('#shippedmessgae').html('Edit Shippment');
	});	
});
</script>
<div class="container">
     <h2 class="main_title">Edit Shipment</h2>
     <div class="def_width_100 f_left"> 
          
          <!--*************matter main************************-->
          <?php echo $form->create('Seller', array('action'=>"", 'id'=>'SellerLoginForm')) ?>
           <input name="data[OrderItem][id]" type="hidden" class="text_ser" style="width:150px;" value="<?php echo $order_item['OrderItem']['id']; ?>">
           
          <div class="def_width_100 f_left">
               <h3 class="mid_title">Order ID :# <?php echo $order_item['OrderDetail']['Order']['tracking_id']; ?></h3>
               <div class="sell_order_mana">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="grid_table_list_2">
                         <tr bgcolor="#eeeeee">
                              <td width="38%" class="text_def_13" style="text-align:left; padding-left:8px;">
                              	<h3 class="text_def_13">Packages Shipped = 1</h3>
                              </td>
                              <td width="35%" >&nbsp;</td>
                              <td width="22%" >&nbsp;</td>
                         </tr>
                    </table>
               </div>
               <div class="pad_10"></div>
               <h3 class="mid_title">Package 1 
               <span class="blue_text" id="shippedmessgae">
               <?php
			   if(isset($order_item['OrderItem']['shipped']) and ($order_item['OrderItem']['shipped']==0)) 
			   {
				   echo "Not Shipped";
			   }
			   else
			   {
				   echo 'Shipped  ' . date('F d, Y h:i:s A',strtotime($order_item['OrderItem']['shipping_start_date'])); 
			   }
			   ?><!--Editing package-->
              </span>
              <span  id="editshipmentclcik"class="f_right" style="margin-right:10px; text-decoration:underline; font-size:14px; font-weight:normal; cursor:pointer; color:#235274;">
              Edit shipment</span>
              </h3>
               <div class="sell_order_mana">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="grid_table_list_2">
                         <tr class="tGb_blk">
                              <th width="60%" colspan="3">Product Details</th>
                              <th width="15%">Item to Ship</th>
                              <th width="15%">Item in Package</th>
                         </tr>
                         <tr>
                              <td width="60%" class="text_def_12" style="text-align:left;" colspan="2">
                               <div class="pad_10"></div>
						   <?php 
			  echo $html->link($order_item['Product']['name'], 
			  array('controller'=>'products', 'action'=>'product', 
			  $order_item['Product']['slug']), array('escape'=>false,'class'=>'blue_link'));
			  ?>
                            <br/>
                                   <span> <b>QTY :</b>  <?php echo $order_item['OrderItem']['qty']; ?> <br/>
                                   <b>WSIN :</b> <?php echo $order_item['Product']['wisn']; ?> <br/>
                                   <b>SKU :</b> <?php echo $order_item['Product']['MasterProduct']['sku']; ?><br/>
                                   <b>Order Item Id :</b> <?php echo $order_item['OrderItem']['order_Item_Id']; ?><br/>
                                   <b>Condition :</b>&nbsp;<?php echo $order_item['Product']['condition']['name']; ?><br/>
                                   </span>
                                    <div class="pad_10"></div>
                                   </td>
                              <td width="15%">     <div class="pad_10"></div>
                  <?php
					if(isset($order_item['OrderItem']['shipped']) and ($order_item['OrderItem']['shipped']==0))
						{
							echo "unshipped";
						}
					else
						{
							echo "shipped";
						}
                 ?>
</td>
                              <td width="15%"> <div class="pad_10"></div>
                                <select name="data[OrderItem][shippedItems]">
									  <?php
                                          for($x=0;$x<=$order_item['OrderItem']['qty'];$x++)
                                              {
												  if($x==$order_item['OrderItem']['qty'])
												  {
													  $selected = "selected='selected'";
												  }
												  else
												  {
													  $selected = ''; 
												  }
                                                  ?>
                                                   <option  <?php echo $selected; ?> value="<?php echo $x; ?>"><?php echo $x; ?></option>
                                                  <?php
                                              }
                                      ?>
                                </select>
                               </td>
                         </tr>
                         <tr bgcolor="#eeeeee">
                              <td  colspan="4" style=" text-align:left;"> <div class="pad_10"></div></td></tr>
                         <tr bgcolor="#eeeeee">
                              <td  colspan="4" style=" text-align:left;" ><span class="blue_text ">
                                   <h3>Total Charges to Client :</h3>
                                   </span></td>
                         </tr>
                         <tr bgcolor="#eeeeee">
                              <td  colspan="4" width="100%" style="text-align:left;"><div class=" def_width_100 f_left">
                                        <div class="width_20 f_left text_def_13">
                                             <label> Ship date </label><br>
                                            <input type="text"  disabled="disabled" value="<?php echo $order_item['OrderItem']['shipping_start_date']; ?>" name="data[OrderItem][shipping_start_date]" />
                                             
                                        </div>
                                        <div class="width_20 f_left text_def_13">
                                             <label> Delievrey date </label> <br>
                                            <input type="text" disabled="disabled" value="<?php echo $order_item['OrderItem']['shipping_end_date']; ?>"  name="data[OrderItem][shipping_end_date]" />
                                            
                                        </div>
                                        <div class="width_20 f_left text_def_13">
                                             <label> Carrier </label>
                                             <br>
                                             <select name="data[OrderItem][shippingsps]" class="select_count1" disabled="disabled">
                                             <?php foreach($shipping_sps_array as $ship){
												  if($ship==$order_item['OrderItem']['shippingsps'])
												  {
													  $selected = "selected='selected'";
												  }
												  else
												  {
													  $selected = ''; 
												  }
												  ?>
                                                  <option  <?php echo  $selected ; ?> value="<?php echo $ship; ?>"><?php echo $ship; ?></option>
											<?php } ?>
                                             </select>
                                        </div>
                                        <div class="width_20 f_left text_def_13">
                                             <label> Shipping Services </label>
                                             <br>
                                             <input disabled="disabled" name="data[OrderItem][shipp_service]" value="<?php echo $order_item['OrderItem']['shipp_service']; ?>" type="text" class="text_ser" style="width:150px;">
                                        </div>
                                        <div class="width_20 f_left text_def_13">
                                             <label> Tracking ID</label>
                                             <br>
                                             <input disabled="disabled" name="data[OrderItem][shipp_tracking]" value="<?php echo $order_item['OrderItem']['shipp_tracking']; ?>"  type="text" class="text_ser" style="width:230px;">
                                        </div>
                                   </div>
                                   <div class="clr"></div>
                                    <div class="pad_10"></div>
                                   </td>
                         </tr>
                         <tr>
                              <td colspan="4" width="100%"><div class="common_border"></div></td>
                         </tr>
                         <tr>
                              <td colspan="4" width="100%"><div class="sellerInfo_gary">
                                        <h5>Your Note</h5>
                                        <div class="pad_10"></div>
                                        <div class="def_width_100 f_left">
                                             <div class="acc_form_1" style="text-align:right;">Seller Memo : </div>
                                             <div class="acc_form_2">
                                                  <textarea name="data[OrderItem][shipping_memo]" value="<?php echo $order_item['OrderItem']['shipping_memo']; ?>"  style="width: 591px; height: 127px;"><?php echo $order_item['OrderItem']['shipping_memo']; ?></textarea>
                                             </div>
                                        </div>
                                        <div class="def_width_100 f_left">
                                             <div class="acc_form_1">&nbsp;</div>
                                             <div class="acc_form_2">
                                                  <input type="submit" class="form_btn" value="Save" name="">
                                             </div>
                                        </div>
                                   </div></td>
                         </tr>
                    </table>
               </div>
          </div>
         <?php echo $form->end(); ?> 
     </div>
</div>
